unit DateDlg;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Mask, ToolEdit;

type
  TfmDate = class(TForm)
    DateEdit1: TDateEdit;
    btnOk: TButton;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmDate: TfmDate;

implementation

{$R *.DFM}

procedure TfmDate.FormKeyPress(Sender: TObject; var Key: Char);
begin
  case Ord(Key) of
    VK_ESCAPE: ModalResult := mrCancel;
  end;
end;

end.
